<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>java79程旭</title>
</head>
<body>
<%!
    SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
    public String toStr(Date d){
        return df.format(d);
    }
%>
 <h1>陈旭是排名第二的帅哥</h1>
 <h2>
<%
    Date d=new Date();
    out.println(d);//out叫内置对象
%>
 </h2>
<h1 style="color:red;font-size:50px">
    <%=toStr(d)%>
</h1>

</body>
</html>
